package com.zzzzzz.core.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;

public class IncludeUtil {
	
	public static void include(PageContext pageContext, String path) throws IOException, ServletException {
	
		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		
		HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();
	
		ServletContext servletContext = request.getSession().getServletContext();
	
		RequestDispatcher requestDispatcher = servletContext.getRequestDispatcher(path);
		
		requestDispatcher.include(request, response);
		
	}

}
